﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Model;
using Newtonsoft.Json;
namespace 三级联动2.Controllers
{
    public class HomeController : Controller
    {
        //
        // GET: /Home/

        public ActionResult Index()
        {
            return View();
        }

        public string show(int id)
        {
            string json = JsonConvert.SerializeObject(GetList(id));
            return json;
        }
        public List<AreaModel> GetList(int id)
        {
            string sql = "select * from AreaFull where AreaPid=" + id;
            return DBHelper.GetList<AreaModel>(sql);
        }
    }
}
